package haxibiao

func fourSumCount(nums1 []int, nums2 []int, nums3 []int, nums4 []int) int {
	hash := map[int]int{}
	count := 0
	for _, x := range nums1 {
		for _, y := range nums2 {
			hash[x+y]++
		}
	}
	for _, x := range nums3 {
		for _, y := range nums4 {
			if v, ok := hash[-x-y]; ok {
				// 问题所在
				count += v
			}
		}
	}
	return count
}
